<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul></ul>
</body>
<script>
    const craet = document.createElement('div');
    document.body.appendChild(craet);
    const lis = document.createElement('li');
    lis.innerHTML = 'li';
    const uls = document.querySelector('ul');
    uls.appendChild(lis);
    const li1 = document.createElement('li');
    li1.innerHTML = '第二个li';
    uls.insertBefore(li1, uls.children[0])
    console.log(li1.parentNode);
    //1.document.createElement('标签名'); 创建节点
    //2.追加节点：父元素.appendChild(插入元素);
    //父元素.insertBefore(插入元素,目标元素前面);
</script>

</html>